# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: speps <speps at aur dot archlinux dot org>

pkgname=vmpk
pkgver=0.8.10
pkgrel=1
pkgdesc="Virtual MIDI Piano Keyboard"
arch=(loong64 x86_64)
url="https://vmpk.sourceforge.io/"
license=(GPL-3.0-or-later)
groups=(pro-audio)
depends=(
  gcc-libs
  glibc
  hicolor-icon-theme
  qt6-base
)
makedepends=(
  cmake
  docbook-xsl
  drumstick
  qt6-tools
)
source=(https://downloads.sourceforge.net/project/$pkgname/$pkgname/${pkgver/a/}/$pkgname-$pkgver.tar.bz2)
sha512sums=('674f6115e60ea02875a485cb722c733d037b7a7212f0e3872b107f233773db8f930db5876f8913e3aa1b49f685c0941bbee20c335b7306bfa1fdd4d272e5ef9e')
b2sums=('0ba3b1df0499c5e9576c23ed402d86c28ce7f92aa77a2e3a563f9779c9901fc9e4b1fb7cfb4da007ae858f550a34428399d055f5a58e5dcaf81a7e7809414ee2')

build() {
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -S $pkgname-$pkgver
    -W no-dev
  )

  cmake "${cmake_options[@]}"
  cmake --build build --verbose
}

package() {
  depends+=(
    drumstick libdrumstick-rt.so libdrumstick-widgets.so
  )

  DESTDIR="$pkgdir" cmake --install build
  install -vDm 644 $pkgname-$pkgver/{AUTHORS,ChangeLog,NEWS,README.md,TODO} -t "$pkgdir/usr/share/doc/$pkgname"
}
